#include <iostream>
using std::cerr;
using std::cout;

#include <new>
using std::bad_alloc;
int main()
{
	double *ptr[50];
	try
	{
		for(int i=0;i<50;i++)
			{
				ptr[i]=new double[500000000];
				cout<<"ptr["<<i<<"] points to 50.000.000 doubles\n";
			}
	}
	catch(bad_alloc &mem)
	{
		cerr<<"exception occurred: "<<mem.what();
	}
	return 0;
}
